import {createRouter, createWebHistory} from 'vue-router';
import Login from '../views/Login.vue';
import Dashboard from '../views/Dashboard.vue';
import Index from '../views/Index.vue';
import Register from '../views/Register.vue';
import UserInfo from '../views/User/UserInfo.vue';
import component from 'element-plus/es/components/tree-select/src/tree-select-option.mjs';


const routes = [
    {path: '/', redirect: '/login'},
    {path: '/login', name: 'Login', component: Login},
    {path: '/register', name: 'Register', component: Register},
    {
        path: '/dashboard', name: 'Dashboard', component: Dashboard, children: [
            {path: 'index', name: 'Index', component: Index},
            {path: 'user_info', name: 'UserInfo', component: UserInfo}
        ],
    },
];

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes,
});

export default router;
